home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks95 / Aaron 1.0b3.sit / Aaron 1.0b3 / Aaron Source / ShowInitIcon 1.0 / Usage < prev    next >
Text File  |  1995-06-24  |  1KB  |  23 lines

  1. How to use:
  2.  
  3. Should I use it as a standalone code resource or link it into my INIT?
  4.  
  5. I recommend linking the code to your INIT resource, because it's easier and cleaner, *provided* that your INIT resource is
  6. written properly, that is, it is destroyed once startup is over. If your INIT installs trap patches, then the code for the trap
  7. patches should be compiled into a separate resource (or code fragment, on the PowerPC) and only the code for the patches
  8. should remain resident. Filling the System heap with old INIT code isn't cool.
  9.  
  10. If you decide to use this code as a standalone resource, here is a snippet that shows how to load and call it:
  11.  
  12. Handle        theResource;
  13.  
  14. theResource = Get1Resource('Code', 7000);
  15. if (theResource)
  16.     ((pascal void (*) (short, Boolean)) *theResource) (myIconFamilyID, true);
  17.  
  18. Note that I don't call HLock because the resource is marked as Locked, and I don't call ReleaseResource because the 
  19. INIT resource file is going to be closed after the INIT executes, unloading all resources.
  20.  
  21. François Pottier <pottier@dmi.ens.fr>
  22. May 11th, 1995
  23.